    <script type="text/javascript">
{literal}
    $(document).ready( function () {
{/literal}
//DD_belatedPNG.fix('.jcarousel-prev');
//DD_belatedPNG.fix('.jcarousel-next');
{if $page == "list_reports"}
        list_reports.init();
        coord2addr.init();
        map.init("{$address}");
        $("#tabs").tabs();
{literal}
	jQuery.validator.addMethod("defaultInvalid", function(value, element) {
		return false;
	}, "");

        jQuery.validator.messages.required = "";
        $("#report-form").validate({
	    invalidHandler: function(e, validator) {
		var errors = validator.numberOfInvalids();
		if (errors) {
		    var msg = "필수항목 " + errors + "가지를 채워주세요!";
		    $("#error-msg").html(msg);
		    $("#error-msg").show();
		} else {
		    $("#error-msg").hide();
		}
	    },
	    focusInvalid:false,
	    onkeyup: false,
	    showErrors: function(errorMap, errorList) {
		this.defaultShowErrors();
	    },
            errorPlacement: function(error, element) {
		return;
            }
	});
{/literal}
{elseif $page == "index"}
        suggest.init();
        jCarousel.init();
{elseif $page == "view_report"}
        map.init("{$lat}", "{$lng}");
	map.related_news("{$address2}");
        $("#tabs").tabs();
    {if $admin == 'true'}
    {literal}
        $("#modify_report_dialog").dialog({width:500, autoOpen: false});
        $("#modify_update_dialog").dialog({width:500, autoOpen: false});
    {/literal}
    {/if}
{literal}
        $("a.image_box").fancybox({'hideOnContentClick': true});
{/literal}
{elseif $page == "total_reports"}
        map.init();
        $("#tabs").tabs();
{elseif $page == "local_alert"}
        suggest.init();
{elseif $page == "local_alert_subscribe"}
	local_alert.init("{$address}");
{/if}
{literal}
    });
{/literal}
 </script>

